package com.wq.order.service;

import com.wq.api.service.capital.CapitalAccountService;
import com.wq.api.service.order.AccountService;
import com.wq.api.service.redpacket.RedPacketAccountService;
import lombok.Builder;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * Created by twinkle.zhou on 16/11/11.
 */
@Service("accountService")
@DubboService
public class AccountServiceImpl implements AccountService {

    @DubboReference
    RedPacketAccountService redPacketAccountService;

    @DubboReference
    CapitalAccountService capitalAccountService;

    @Override
    public BigDecimal getRedPacketAccountByUserId(long userId){
        return redPacketAccountService.getRedPacketAccountByUserId(userId);
    }

    @Override
    public BigDecimal getCapitalAccountByUserId(long userId){
        return capitalAccountService.getCapitalAccountByUserId(userId);
    }
}
